package com.cn.gmall.activity.client;

import com.cn.gmall.activity.client.impl.ActivityDegradeFeign;
import com.cn.gmall.common.result.Result;
import com.cn.gmall.model.activity.SeckillGoods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@FeignClient(value = "service-activity",fallback = ActivityDegradeFeign.class)
public interface ActivityFeign {
    /** 秒杀确认页 -拿地址信息 ->生成订单详情
     * /api/activity/seckill/auth/trade
     *
     * @return
     */
    @GetMapping("/api/activity/seckill/auth/trade")
    public Result<Map<String, Object>> trade();
    /***
     * 根据skuId获取数据(数据来源redis)
     * /api/activity/seckill/getSeckillGoods/{skuId}
     * @param skuId
     * @return
     */
    @GetMapping("/api/activity/seckill/getSeckillGoods/{skuId}")
    public Result getSeckillGoodsBySkuId(@PathVariable Long skuId);

    /**
     * /api/activity/seckill/findAll
     * 查询秒杀列表数据
     * @return
     */
    @GetMapping("/api/activity/seckill/findAll")
    public Result findAll();

}
